﻿using AnesSystem.Models;
using AnesSystem.ViewModels.Operation.CQ.CQTL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls.Operation.CQ.CQTL
{
    /// <summary>
    /// MedicElement.xaml 的交互逻辑
    /// </summary>
    public partial class MedicineElementCtrl : UserControl
    {

        #region Variables

        #endregion

        #region Constructor
        public MedicineElementCtrl()
        {
            InitializeComponent();
        }
        #endregion

        #region Properties

        #endregion

        #region 依赖属性
        public ItemModel Item
        {
            get { return (ItemModel)GetValue(ItemProperty); }
            set { SetValue(ItemProperty, value); }
        }

        // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ItemProperty =
            DependencyProperty.Register("Item", typeof(ItemModel), typeof(MedicineElementCtrl), new PropertyMetadata(null));

        public List<ConfigUnitsModel> ConfigUnitsModelList
        {
            get { return (List<ConfigUnitsModel>)GetValue(ConfigUnitsModelListProperty); }
            set { SetValue(ConfigUnitsModelListProperty, value); }
        }

        // Using a DependencyProperty as the backing store for ConfigUnitsModelList.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ConfigUnitsModelListProperty =
            DependencyProperty.Register("ConfigUnitsModelList", typeof(List<ConfigUnitsModel>), typeof(MedicineElementCtrl), new PropertyMetadata(null));

        public bool DoseEnable
        {
            get { return (bool)GetValue(DoseEnableProperty); }
            set { SetValue(DoseEnableProperty, value); }
        }

        // Using a DependencyProperty as the backing store for ConfigUnitsModelList.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty DoseEnableProperty =
            DependencyProperty.Register("DoseEnable", typeof(bool), typeof(MedicineElementCtrl), new PropertyMetadata(true));



        public bool UnitEnable
        {
            get { return (bool)GetValue(UnitEnableProperty); }
            set { SetValue(UnitEnableProperty, value); }
        }

        // Using a DependencyProperty as the backing store for UnitEnable.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty UnitEnableProperty =
            DependencyProperty.Register("UnitEnable", typeof(bool), typeof(MedicineElementCtrl), new PropertyMetadata(true));


        #endregion

        #region Event

        #endregion

        #region Private Methods

        #endregion

        #region Public/Protected Methods

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            MedicineConfigCtrlViewModel.Instance.DelDrug(this);
        }

        #endregion

        #region EventHandlers

        #endregion
    }
}
